<%-- 
    Document   : candidateList
    Created on : Oct 28, 2012, 4:25:48 PM
    Author     : King
--%>
<%@include file="../mastertemplate/header.jsp" %>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.ArrayList"%>
<%@page import="entityclasses.CandidateList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <div class="span9">
            <%
                if (request.getAttribute("candiList") != null) {
                    CandidateList canmap = (CandidateList) request.getAttribute("candiList");
                    ArrayList<Integer> comList = canmap.getCom_id();
                    HashMap<Integer, ArrayList<Integer>> ht_Group = canmap.getHt_Group();
                    HashMap<Integer, Integer> ht_Max = canmap.getHt_Max();
                    HashMap<Integer, ArrayList<Integer>> ht_Candidate_Id = canmap.getHt_Candidate_Id();
                    HashMap<Integer, String> ht_Candidate_Name = canmap.getHt_Candidate_Name();
                    HashMap<Integer, String> ht_Committee_Name = canmap.getHt_Committee_Name();
                    ArrayList<Integer> group;
                    ArrayList<Integer> candidate_id;
                    int max;
            %>
            <form action="../candidateList" method="post">
                <div class="">
                    <% for (int i = 0; i < comList.size(); i++) {%>
                    <div class="">
                        <% group = ht_Group.get(comList.get(i));%>
                        <label class=""><%= ht_Committee_Name.get(comList.get(i))%></label>
                        <% for (int groupid = 0; groupid < group.size(); groupid++) {%>
                        <div class="">
                            <% candidate_id = ht_Candidate_Id.get(group.get(groupid));%>
                            <% max = ht_Max.get(group.get(groupid));%>
                            <% for (int candi = 0; candi < candidate_id.size(); candi++) {%>
                            <div class="">
                                <div class="">
                                    <%=ht_Candidate_Name.get(candidate_id.get(candi))%>
                                </div>
                                <div class="">
                                    <% for (int k = 0; k < max; k++) {%>
                                    <input type="radio" value="max" />
                                    <%}%>
                                </div>
                            </div>
                            <%}%>
                        </div>
                        <%}%>
                    </div>
                    <%}%>
                </div>
                <%}%>
                <input type="submit" class="btn btn-primary" value="Submit" id="submitfrm" />
            </form>
        </div>
    </body>
    <%@include file="../mastertemplate/footer.jsp" %>
</html>
